/*
 * RSBoolArray.h
 *
 *  Created on: 2010/03/17
 *      Author: alexandre
 */

#ifndef RSBOOLARRAY_H_
#define RSBOOLARRAY_H_

#include "RSArrayElement.h"
#include <QVector>

namespace Realsphere {

    class RSBoolArray : public Realsphere::RSArrayElement {
        Q_OBJECT
        public:
            RSBoolArray ();
            RSBoolArray ( const QString& rId );
            RSBoolArray ( const QString& rId, const QString& rName );
            RSBoolArray ( const bool rArray[] );
            RSBoolArray ( const bool rArray[], const QString& rId );
            RSBoolArray ( const bool rArray[], const QString& rId, const QString& rName );
            RSBoolArray ( const bool* rArray, unsigned int rSize );
            RSBoolArray ( const bool* rArray, unsigned int rSize , const QString& rId );
            RSBoolArray ( const bool* rArray, unsigned int rSize , const QString& rId, const QString& rName );

            ~RSBoolArray ();
        public:

            RSArrayElementType              ArrayType () const;
            int                             Count () const;
            RSDataPointer                   DataPointer ();
            RSDataSize                      SizeOf () const;
            QString                         ToString () const;

        public slots:
            void                            Clear( bool rEmit = true );
            void                            Append ( const RSValueElement& rValue, bool rEmit = true );
            void                            Append ( const RSBool& rValue, bool rEmit = true );
            void                            Append ( const bool& rValue, bool rEmit = true );
            void                            Append ( const bool rValue[], bool rEmit = true );
            void                            Append ( const bool* rValue, unsigned int rSize, bool rEmit = true );
            void                            Remove ( unsigned int rIndex, bool rEmit = true );
            void                            Remove ( unsigned int rIndex, unsigned int rSize, bool rEmit = true );
            void                            SetValue ( unsigned int rIndex, const RSValueElement& rValue, bool rEmit = true );
            void                            SetValue ( unsigned int rIndex, const RSBool& rValue, bool rEmit = true );
            void                            SetValue ( unsigned int rIndex, const bool& rValue, bool rEmit = true );

        public:
            bool&                           operator[] ( int rIndex );
            const bool&                     operator[] ( int rIndex ) const;

        private:
            QVector<bool>                 mData;
    };

}

#endif /* RSBOOLARRAY_H_ */
